button: Call the new function
authorBenjamin Otte <otte@redhat.com>
Mon, 2 Dec 2013 20:24:30 +0000 (21:24 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 3 Dec 2013 00:57:38 +0000 (01:57 +0100)
This simplifies a lot of code and doesn't require hacks setting
in_button anymore.

gtk/gtkbutton.c

index 21c537cc714a7531121e37700f88c080e4def443..6bcf1975e4c0aa04685057bc0e32a5f82555194e 100644 (file)
@@ -1995,21 +1995,8 @@ gtk_button_grab_broken (GtkWidget          *widget,
                        GdkEventGrabBroken *event)
 {
   GtkButton *button = GTK_BUTTON (widget);
-  GtkButtonPrivate *priv = button->priv;
-  gboolean save_in;
   
-  /* Simulate a button release without the pointer in the button */
-  if (priv->button_down)
-    {
-      save_in = priv->in_button;
-      priv->in_button = FALSE;
-      gtk_real_button_released (button);
-      if (save_in != priv->in_button)
-       {
-         priv->in_button = save_in;
-         gtk_button_update_state (button);
-       }
-    }
+  gtk_button_do_release (button, FALSE);
 
   return TRUE;
 }
@@ -2721,7 +2708,7 @@ gtk_button_state_changed (GtkWidget    *widget,
   if (!gtk_widget_is_sensitive (widget))
     {
       priv->in_button = FALSE;
-      gtk_real_button_released (button);
+      gtk_button_do_release (button, FALSE);
     }
 }
 
@@ -2731,7 +2718,6 @@ gtk_button_grab_notify (GtkWidget *widget,
 {
   GtkButton *button = GTK_BUTTON (widget);
   GtkButtonPrivate *priv = button->priv;
-  gboolean save_in;
 
   if (priv->activate_timeout &&
       priv->grab_keyboard &&
@@ -2739,16 +2725,7 @@ gtk_button_grab_notify (GtkWidget *widget,
     gtk_button_finish_activate (button, FALSE);
 
   if (!was_grabbed)
-    {
-      save_in = priv->in_button;
-      priv->in_button = FALSE;
-      gtk_real_button_released (button);
-      if (save_in != priv->in_button)
-        {
-          priv->in_button = save_in;
-          gtk_button_update_state (button);
-        }
-    }
+    gtk_button_do_release (button, FALSE);
 }
 
 /**